﻿#Define clock class
import time
class Clock():
    def __init__(self,hour = 0,minute = 0,second = 0):
        #Define the propertise of an object
        self.hour = hour
        self.min = minute
        self.sec = second
    def run(self):
        self.sec += 1
        if self.sec == 60:
            self.sec = 0
            self.min += 1
            if self.min == 60:
                self.hour += 1
                self.min = 0
                if self.hour == 24:
                    self.hour = 0
    def show(self):
        return (f'{self.hour:02d}:{self.min:02d}:{self.sec:02d}')

clock = Clock()
while True:
    print(clock.show())
    time.sleep(1)
    #Run once every second
    clock.run()


